
extension DateExtension on DateTime {

  DateTime addMonth(int month) {
    int newYear = this.year;
    int newMonth = this.month + month;

    while (newMonth > 12) {
      newYear++;
      newMonth -= 12;
    }

    while (newMonth < 1) {
      newYear--;
      newMonth += 12;
    }

    return DateTime(newYear, newMonth, this.day);
  }
}